Field of the Invention
The present invention generally relates to query processing and, more particularly, to managing access by multiple users to persistently stored queries.
Description of the Related Art
Databases are computerized information storage and retrieval systems. A relational database management system is a computer database management system (DBMS) that uses relational techniques for storing and retrieving data. The most prevalent type of database is the relational database, a tabular database in which data is defined so that it can be reorganized and accessed in a number of different ways. A distributed database is one that can be dispersed or replicated among different points in a network. An object-oriented programming database is one that is congruent with the data defined in object classes and subclasses.
Regardless of the particular architecture, a DBMS can be structured to support a variety of different types of operations. Such operations can be configured to retrieve, add, modify and delete information being stored and managed by the DBMS. Standard database access methods support these operations using high-level query languages, such as the Structured Query Language (SQL). The term “query” denominates a set of commands that cause execution of operations for processing data from a stored database. For instance, SQL supports four types of query operations, i.e., SELECT, INSERT, UPDATE and DELETE. A SELECT operation retrieves data from a database, an INSERT operation adds new data to a database, an UPDATE operation modifies data in a database and a DELETE operation removes data from a database.
Any requesting entity, including applications, operating systems and, at the highest level, users, can issue queries against data in one or more databases. Queries may be hard coded as part of an application or may be generated in response to input (e.g., user input). A given requesting entity may execute a multiplicity of different queries. Upon execution of each query against one or more databases, a corresponding query result is returned to the requesting entity. Any query and/or corresponding query result(s) can be stored persistently.
Persistently stored queries and/or query results can be shared by multiple users. In other words, queries which are created by a given user can be stored persistently and made available to other users. The given user may even create queries which are only intended for use by one or more other users. For instance, a database administrator may create predefined queries in a particular query language for users which need to retrieve information from one or more underlying databases, but which are not familiar with the particular query language. Thus, these users simply need to execute the predefined queries to retrieve required information from the underlying database(s).
However, one difficulty in sharing persistently stored queries between multiple users is that a particular predefined query may not exactly satisfy the needs of different users. For instance, assume that a database administrator in a company has created predefined queries using a specific query language which are intended for use by sales managers of the company. The predefined queries may be relatively complex queries that are suitable to retrieve data related to individuals of different target groups. Assume further that a given sales manager starts selling a new product of the company. Accordingly, the given sales manager may identify a corresponding target group for the new product and gather information about individuals in this target group using a corresponding predefined query.
The given sales manager may then precisely address an advertising campaign to the individuals in the identified target group using the gathered information. Assume now that the identified target group consists of teenagers and young adults which are 14 to 25 years old and which satisfy various conditions, such as having particular hobbies. Assume further that a predefined query exists which is adapted to retrieve information for 18 to 25 year old teenagers and young adults, which satisfy the same various conditions. The given sales manager may use this predefined query, but the predefined query must be modified in order to request also the required information related to those 14 to 17 years old.
However, after modification, the predefined query is no longer directed towards the original 18 to 25 year old target group. In other words, a general intent of the predefined query is changed by the modification. This change may affect subsequent executions of the predefined query by other users which would only require information related towards the original target group. Furthermore, in some instances, the predefined query can be damaged unintentionally during modification, especially if the sales manager is not familiar with the specific query language.
Therefore, there is a need for an efficient technique for sharing persistently stored queries between multiple users which disables undesired modifications to the persistently stored queries.